package chapter12.section3;

/*程序12-5a：容纳账户信息的花名册类，运行于服务器端*/
import java.util.HashMap;
import java.util.Map;

public final class AccountPool {
	private static Map<String, Account> accounts = new HashMap<String, Account>();
	static {
		accounts.put("001", new Account("001", "王峰", 1000));
		accounts.put("002", new Account("002", "张静", 1500));
		accounts.put("003", new Account("003", "鲁宁", 800));
		accounts.put("004", new Account("004", "翟宇", 660));
		accounts.put("005", new Account("005", "刘新", 1700));
	}

	private AccountPool() {
	}

	public static Account getAccount(String id) {
		return accounts.get(id);
	}
}